home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / win / c / regexp.com / WSSRX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-16  |  1.9 KB  |  51 lines

  1. /****************************************************************************
  2.  * Regular Expressions Library                                                             *
  3.  * Copyright (c) 1989 by Windfall Software Systems.  All Rights Reserved.     *
  4.  ****************************************************************************
  5.  * API definitions - wssrx.h                                                                  *
  6.  ****************************************************************************/
  7.  
  8. #ifndef    WSSDEF_RX                // Prevent redefinition
  9.  
  10. typedef
  11. struct {                                // Element of a feedback array
  12.     WORD     pos;                        // Starting position of a group match
  13.     WORD     size;                    // Its size
  14.     }    RX;
  15.  
  16. BOOL    PASCAL FAR 
  17. RxMatch(RX FAR rx[],short nLim,LPSTR lszRex,LPSTR lszTxt);
  18.  
  19. LPSTR PASCAL FAR
  20. RxExtract(RX FAR rx[],short nN,LPSTR lszTxt,LPSTR lszDst,short nSize);
  21.  
  22. LPSTR    PASCAL FAR
  23. RxReplace(RX FAR rx[],short nLim,LPSTR lszTxt,LPSTR lszDst,short nSize);
  24.  
  25. int PASCAL FAR
  26. RxMsgText(RX FAR rx[],LPSTR lszMsg,short nSize);
  27.  
  28.                                         /* Ordinal numbers of the functions    for use     */
  29.                                         /* with GetProcAddress() to achieve the         */
  30.                                         /* dynamic linking
  31. #define    OV_RXMATCH        MAKEINTRESOURCE(1)
  32. #define    OV_RXEXTRACT    MAKEINTRESOURCE(2)
  33. #define    OV_RXREPLACE    MAKEINTRESOURCE(3)
  34. #define    OV_RXMSGTEXT    MAKEINTRESOURCE(4)
  35.  
  36.                                         /* Error codes                                             */
  37. #define    ERR_NULLPARM    1        /* Rex or Txt parameter is NULL                     */
  38. #define    ERR_REXTOOLONG    2        /* Rex too long                                         */
  39. #define    ERR_TOODEEP        3        /* {{{ }}} too deep                                     */
  40. #define    ERR_NORBRACE    4        /* Missing right parenthesis                         */
  41. #define    ERR_NOLBRACE    5        /* Missing left parenthesis                         */
  42. #define    ERR_EMPTYITER    6        /* Iteration (+*) on empty string                 */
  43. #define    ERR_NESTEDITER    7        /* Nested iteration                                     */
  44. #define    ERR_RANGEINV    8        /* Invalid range                                         */
  45. #define    ERR_NORBRACKET    9        /* Missing right bracket                             */
  46. #define    ERR_ENDESCAPE    10        /* Incomplete escape sequence                         */
  47. #define    ERR_LOGIC        11        /* Logic error                                             */
  48.  
  49. #define    WSSDEF_RX
  50. #endif
  51.